package com.bajiao.dto.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.bajiao.common.util.vans.RegexTool;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.util.Date;

@Data
@ApiModel("StoreApplyRequest")
public class StoreApplyRequest extends StoreApplyStep1Request{

    @ApiModelProperty(value = "公司名称")
    private String companyName;

    @ApiModelProperty(value = "公司介绍")
    private String companyIntro;

    @ApiModelProperty(value = "公司行业名称")
    @NotBlank(message = "请选择所属行业")
    private String industryName;

    @ApiModelProperty(value = "营业执照")
    private String licenseImage;

    @ApiModelProperty(value = "营业执照编号")
    private String licenseNumber;

    @ApiModelProperty(value = "营业执照类型 1-长期 2-非长期")
    private Integer licenseType;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "营业执照生效时间")
    private Date licenseStartDate;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "营业执照失效时间")
    private Date licenseEndDate;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "成立时间")
    private Date foundDate;

    @NotBlank(message = "请选择所在地")
    @Length(max = 50, message = "所在地内容过长")
    @ApiModelProperty(value = "公司注册地/商户市区")
    private String registerAddress;

    @NotBlank(message = "请填写详细地址")
    @Length(max = 100, message = "详细地址内容过长")
    @ApiModelProperty(value = "公司所在地/商户详细地址")
    private String companyAddress;

    @NotBlank(message = "请填写法人名称")
    @Length(max = 20, message = "法人名称过长")
    @ApiModelProperty(value = "法人名称")
    private String legalPerson;

    @NotBlank(message = "请填写法人身份证号")
    @Length(min = 18, max = 18, message = "法人身份证号格式错误")
    @ApiModelProperty(value = "身份证号")
    private String idCard;

    @NotNull(message = "请选择身份证类型")
    @Range(min = 1, max = 2, message = "请选择有效的身份证类型")
    @ApiModelProperty(value = "身份证类型 1-长期 2-非长期")
    private Integer idCardType;

    @NotNull(message = "请填写身份证生效时间")
    @Past(message = "请填写有效的身份证生效时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "身份证生效时间")
    private Date idCardStartDate;

    @NotNull(message = "请填写身份证失效时间")
    //@Future(message = "请填写有效的身份证失效时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "身份证失效时间")
    private Date idCardEndDate;

    @NotBlank(message = "请上传身份证正面图片")
    @ApiModelProperty(value = "身份证正面")
    private String idCardFrontImage;

    @NotBlank(message = "请上传身份证反面图片")
    @ApiModelProperty(value = "身份证反面")
    private String idCardBackImage;

    @NotBlank(message = "请填写联系电话")
    @Pattern(regexp = RegexTool.mobileRegex, message = "请填写有效的联系电话")
    @ApiModelProperty(value = "联系电话")
    private String mobile;

    @NotBlank(message = "请填写邮箱号")
    @Pattern(regexp = RegexTool.emailRegex, message = "请填写有效的邮箱号")
    @ApiModelProperty(value = "邮箱号")
    private String email;

    @NotBlank(message = "请上传内景照片")
    @ApiModelProperty(value = "内景照片")
    private String interiorImage;

    @NotBlank(message = "请上传前台照片")
    @ApiModelProperty(value = "前台照片")
    private String receptionImage;

    @NotBlank(message = "请上传店铺门头照")
    @ApiModelProperty(value = "门头照")
    private String mainImage;
}
